package com.yx.gsyd.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.yx.gsyd.service.ISmsService;
import com.yx.gsyd.sms.AliSMS;
import com.yx.gsyd.util.IdentityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class SmsServiceImpl implements ISmsService {

    @Autowired
    private AliSMS aliSMS;

    @Async("myAsync")
    @Override
    public void SendSms(String phone,String name) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", name);
        //SMS_472640005
        this.aliSMS.sendSms(phone,jsonObject.toJSONString(),"SMS_473280333");

    }

    @Async("myAsync")
    @Override
    public void SendSmsQy(String phone, String name,String qyName) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("name", name);
        jsonObject.put("unit_name", qyName);
        //SMS_472640005
        this.aliSMS.sendSms(phone,jsonObject.toJSONString(),"SMS_474865982");
    }


}
